#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020-08-28 2:13 下午
# @Author  : yangdy
# @File    : 2020-08-28.657.机器人能否返回原点
# @Software: PyCharmCE

class Solution:
    def judgeCircle(self, moves: str) -> bool:
        if not moves:
            return True
        steps = {'U': (-1, 0), 'D': (1, 0), 'R': (0, 1), 'L': (0, -1)}
        x, y = 0, 0
        for m in moves:
            x, y = x+steps[m][0], y+steps[m][1]
        return x == 0 and y == 0
